package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class Video extends BaseDomain {

    public static final Integer STATE_WRITE = 0; //待审核
    public static final Integer STATE_OK = 1;   //通过
    public static final Integer STATE_NG = -1;  //未通过
    private String title;
    private String subTitle;
    private String imgUrl;
    private String vidUrl;
    @JsonFormat(pattern = ("yyyy-MM-dd HH:mm"),timezone = "GMT+8")
    private Date time;
    private User user;
    private Integer state = STATE_WRITE;
    private Integer lookNum = 0 ;
    public String getStateStr(){
        if (state == STATE_WRITE){
            return "待审核";
        }
        if (state == STATE_OK){
            return "已发布";
        }
        if (state == STATE_NG){
            return "未过审";
        }
        return "未知";
    }
}